<html>
<head><meta charset="utf-8"><title>Placeholder invariants · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Placeholder.20invariants.html">Placeholder invariants</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="199977957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Placeholder%20invariants/near/199977957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Placeholder.20invariants.html#199977957">(Jun 06 2020 at 14:39)</a>:</h4>
<p>What are the invariants of <code>Placeholder</code>/<code>PlaceholderRegion</code>?</p>



<a name="199977962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Placeholder%20invariants/near/199977962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Placeholder.20invariants.html#199977962">(Jun 06 2020 at 14:39)</a>:</h4>
<p><a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/struct.InferCtxt.html#method.replace_bound_vars_with_placeholders">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/struct.InferCtxt.html#method.replace_bound_vars_with_placeholders</a>:</p>
<blockquote>
<p>Important: you must call this function from within a snapshot. Moreover, before committing the snapshot, you must eventually call either plug_leaks or pop_placeholders to remove the placeholder regions. If you rollback the snapshot (or are using a probe), then the pop occurs as part of the rollback, so an explicit call is not needed (but is also permitted).</p>
</blockquote>
<p>Which is outdated, as both <code>plug_leaks</code> already doesn't exist and <code>pop_placeholders</code> will be removed in <a href="https://github.com/rust-lang/rust/issues/73055">#73055</a></p>



<a name="199977966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Placeholder%20invariants/near/199977966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Placeholder.20invariants.html#199977966">(Jun 06 2020 at 14:39)</a>:</h4>
<p>The <code>rustc-dev-guide</code> also mentions <code>higher_ranked::plug_leaks</code>:<br>
<a href="https://rustc-dev-guide.rust-lang.org/traits/hrtb.html#higher-ranked-trait-obligations">https://rustc-dev-guide.rust-lang.org/traits/hrtb.html#higher-ranked-trait-obligations</a></p>



<a name="199977967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Placeholder%20invariants/near/199977967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Placeholder.20invariants.html#199977967">(Jun 06 2020 at 14:39)</a>:</h4>
<p>We currently mostly call <code>leak_check</code> after <code>replace_bound_vars_with_placeholders</code>, except in some places during trait selection.</p>



<a name="200158222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Placeholder%20invariants/near/200158222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Placeholder.20invariants.html#200158222">(Jun 08 2020 at 21:27)</a>:</h4>
<p><span class="user-mention" data-user-id="216206">@lcnr</span> that is outdated, yeah</p>



<a name="200158224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Placeholder%20invariants/near/200158224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Placeholder.20invariants.html#200158224">(Jun 08 2020 at 21:27)</a>:</h4>
<p>plug-leaks is gone</p>



<a name="200158243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Placeholder%20invariants/near/200158243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Placeholder.20invariants.html#200158243">(Jun 08 2020 at 21:27)</a>:</h4>
<p>I should update rustc-dev-guide I guess</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>